package com.ag.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbEventmackup entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_EVENTMACKUP", schema = "dbo", catalog = "AGDB")
public class TbEventmackup implements java.io.Serializable {

	// Fields

	private String emId;
	private TbUser tbUser;
	private TbEvent tbEvent;
	private String emContext;
	private Date emTime;
	private String a;
	private String b;
	private String c;
	private Set<TbMackupAnnex> tbMackupAnnexes = new HashSet<TbMackupAnnex>(0);

	// Constructors

	/** default constructor */
	public TbEventmackup() {
	}

	/** minimal constructor */
	public TbEventmackup(String emId, String emContext, Date emTime) {
		this.emId = emId;
		this.emContext = emContext;
		this.emTime = emTime;
	}

	/** full constructor */
	public TbEventmackup(String emId, TbUser tbUser, TbEvent tbEvent,
			String emContext, Date emTime, String a, String b, String c,
			Set<TbMackupAnnex> tbMackupAnnexes) {
		this.emId = emId;
		this.tbUser = tbUser;
		this.tbEvent = tbEvent;
		this.emContext = emContext;
		this.emTime = emTime;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbMackupAnnexes = tbMackupAnnexes;
	}

	// Property accessors
	@Id
	@Column(name = "EM_ID", unique = true, nullable = false, length = 10)
	public String getEmId() {
		return this.emId;
	}

	public void setEmId(String emId) {
		this.emId = emId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "U_ID")
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "E_ID")
	public TbEvent getTbEvent() {
		return this.tbEvent;
	}

	public void setTbEvent(TbEvent tbEvent) {
		this.tbEvent = tbEvent;
	}

	@Column(name = "EM_CONTEXT", nullable = false, length = 4000)
	public String getEmContext() {
		return this.emContext;
	}

	public void setEmContext(String emContext) {
		this.emContext = emContext;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "EM_TIME", nullable = false, length = 23)
	public Date getEmTime() {
		return this.emTime;
	}

	public void setEmTime(Date emTime) {
		this.emTime = emTime;
	}

	@Column(name = "A", length = 50)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 50)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 50)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbEventmackup")
	public Set<TbMackupAnnex> getTbMackupAnnexes() {
		return this.tbMackupAnnexes;
	}

	public void setTbMackupAnnexes(Set<TbMackupAnnex> tbMackupAnnexes) {
		this.tbMackupAnnexes = tbMackupAnnexes;
	}

}